import MineApi from '@/API/mine/index.js';

const mineApi = new MineApi();

export default {
	state: {
		info: {},
		flag: false,
		userInfo: {}
	},
	getters: {
		
	},
	mutations: {
		setUserInfo(state,userInfo) {
			state.userInfo=userInfo
		},
		setSpreadInvitationCode (state,spreadInvitationCode){
			state.userInfo.spreadInvitationCode = spreadInvitationCode
		}
	},
	actions: {
		async setUserInfo(context) {
			let res = await mineApi.getUserInfo()
			context.commit('setUserInfo',res.data)
		},
		setInvitationCode (context,spreadInvitationCode){
			context.commit('setInvitationCode',spreadInvitationCode)
		}
	},
};